<script setup>
import {onBeforeUnmount, onMounted, ref, version} from 'vue'
import axios from 'axios'

const ss = ref('')
let tt;

function get() {
  axios.get('http://localhost/tt.php').then(res => ss.value = res.data)
}

get()
onMounted(() => {
  tt = setInterval(get, 1000)
})
onBeforeUnmount(() => {
  clearInterval(tt)
})

</script>

<template>
  <h1>{{ ss }}</h1>
  <h1>hello world vue {{ version }}</h1>
  <h1>axios {{ axios.VERSION }}</h1>
  <p v-for="i in 5">hello vue for {{ i }}</p>
  <h4 v-for="i in 5">hello vue for {{ 5 + 1 - i }}</h4>
</template>

<style scoped>

</style>
